home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / midi / gfft.lha / gfft-2.03 / source / gfft-2.03-source.lha / wbnag.c < prev    next >
C/C++ Source or Header  |  1996-01-02  |  4KB  |  138 lines

  1. /***************************************************************************
  2.  *          Copyright (C) 1995  Charles P. Peterson                  *
  3.  *         4007 Enchanted Sun, San Antonio, Texas 78244-1254             *
  4.  *              Email: Charles_P_Peterson@fcircus.sat.tx.us                *
  5.  *                                                                         *
  6.  *          This is free software with NO WARRANTY.                  *
  7.  *          See gfft.c, or run program itself, for details.              *
  8.  *              Support is available for a fee.                      *
  9.  ***************************************************************************
  10.  *
  11.  * Program:     gfft--General FFT analysis
  12.  * File:        wbnag.c
  13.  * Purpose:     'nag' requester
  14.  * Author:      Charles Peterson (CPP)
  15.  * History:     27-Jan-95 (1.28) CPP; Created.
  16.  * Comments:    Workbench GUI.  Amiga Dependent!
  17.  */
  18.  
  19. #ifdef AMIGA  /* This module is AMIGA dependent */
  20.  
  21. #include <stdio.h>     /* sprintf() */
  22.  
  23. /*
  24.  * Amiga includes
  25.  */
  26. #include <exec/types.h>
  27. #include <workbench/workbench.h>
  28. #include <intuition/intuition.h>
  29. #include <clib/intuition_protos.h>
  30. #include <clib/exec_protos.h>
  31. #include <dos.h> /* chkabort() */
  32.  
  33. #define NONAG FALSE
  34.  
  35. /*
  36.  * GFFT includes
  37.  */
  38. #include "gfft.h"
  39. #include "settings.h"
  40. #include "wbench.h"
  41.  
  42. /*
  43.  * External globals
  44.  */
  45. extern struct Window *dialog_window_p;
  46.  
  47. static struct Requester *nag_rp = NULL;
  48.  
  49. static struct Gadget *end_nag_gadgetp;
  50. static struct IntuiText *line1_textp;
  51. static struct IntuiText *line2_textp;
  52. static struct IntuiText *line3_textp;
  53. static struct IntuiText *line4_textp;
  54. static struct IntuiText *line5_textp;
  55. static struct IntuiText *line6_textp;
  56. static struct IntuiText *line7_textp;
  57.  
  58.  
  59. void workbench_nag_requester (void)
  60. {
  61.     static nagged_already = FALSE;
  62.     struct IntuiMessage *message;
  63.     APTR *address = NULL;
  64.     int key = 0;
  65.  
  66.     if (NONAG || nagged_already) return;
  67.  
  68.     nagged_already = TRUE;
  69.  
  70.     if (!nag_rp)
  71.     {
  72.     gadget__begin (GTYP_REQGADGET);
  73. /*
  74.  * Setup Text
  75.  */
  76.     line1_textp = requester_text__new (
  77. "PLEASE help the author support this program by sending a donation today."
  78.    , 0, 0);
  79.  
  80.     line2_textp = requester_text__new (
  81. "Any amount will be appreciated, but for only $10, I'll send thanks"
  82.    , 0, 1);
  83.  
  84.     line3_textp = requester_text__new (
  85. "    and tell you how to make this nag requester to go away.  For $25,"
  86.    , 0, 2);
  87.  
  88.     line4_textp = requester_text__new (
  89. "    I'll send you the FPU optimized version right away (see README)."
  90.    , 0, 3);
  91.  
  92.     line5_textp = requester_text__new (
  93. "Charles Peterson, 4007 Enchanted Sun, San Antonio, TX 78244-1254 USA"
  94.    , 0, 4);
  95.  
  96.     line6_textp = requester_text__new (
  97. "There is ABSOLUTELY NO WARRANTY.  Click Version/Copyright button (after"
  98.    , 0, 5);
  99.  
  100.     line7_textp = requester_text__new (
  101. "clicking this message away) for details and your copying rights."
  102.    , 0, 6);
  103.  
  104. /*
  105.  * Setup Gadgets
  106.  */
  107.     end_nag_gadgetp = tall_action_button__new
  108.       ("...OK",
  109.        68, 6);
  110.  
  111.     nag_rp = requester__new ();
  112.     nag_rp->ReqGadget = end_nag_gadgetp;
  113.     nag_rp->ReqText = line7_textp;
  114.  
  115.     } /* Ok, nag_rp has been created */
  116.     
  117.     if (requester__display (nag_rp, dialog_window_p))
  118.     {
  119.     while (TRUE)
  120.     {
  121.         Wait (1 << dialog_window_p->UserPort->mp_SigBit);
  122.         while (message = (struct IntuiMessage *) GetMsg 
  123.            (dialog_window_p->UserPort))
  124.         {
  125.         address = message->IAddress;
  126.         ReplyMsg ((struct Message *) message);
  127.         if (address == (APTR) end_nag_gadgetp)
  128.         {
  129.             requester__remove (nag_rp, dialog_window_p);
  130.             return;
  131.         }
  132.         }
  133.     }
  134.     }
  135. }
  136.  
  137. #endif /* end ifdef AMIGA */
  138.